<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Fabrice
 * Date: 25/02/14
 * Time: 18:08
 * To change this template use File | Settings | File Templates.
 */

class ModeleConcert {
    public static function getLesConcerts()
    {
        return ModelePDO::getLesTuples('concert');
    }

    public static function getLesConcertsOrderByDate()
    {
        return ModelePDO::getLesTuplesOrderBy('concert', 'date');
    }

    public static function insertConcert($date, $lieu)
    {
        $id = ModelePDO::genererClePrimaire('concert', 'id');
        ModelePDO::insertTuple('concert', array($id, $date, $lieu));
        return $id;
    }

    public static function updateConcert($id, $date, $lieu)
    {
        ModelePDO::updateTuplesByChamp('concert', array('date', 'lieu'), array($date, $lieu), 'id', $id);
    }

    public static function deleteConcertByID($id)
    {
        ModelePDO::deleteTuplesByChamp('concert', 'id', $id);
    }
}